package sellComputer;

public class Computer1 {
	private String name;
	public AMDCpu amdCpu;
	public KingstonMem kingstonMem;
	public SeagateHD seagateHd;
	public GigabyteMB gigabyteMb;
	
	
	
	
	public Computer1 (String name,AMDCpu amdCpu,KingstonMem kingstonMem,SeagateHD seagateHd,GigabyteMB gigabyteMb) {
		this.name = name;
		this.amdCpu = amdCpu;
		this.kingstonMem = kingstonMem;
		this.seagateHd = seagateHd;
		this.gigabyteMb = gigabyteMb;
	}
	
	public String getName() {
		return name;
	}
	
	public int totalMoney(Computer1 computer) {
		int total = 0;
		total += computer.amdCpu.getPrice();
		total += computer.kingstonMem.getPrice();
		total += computer.seagateHd.getPrice();
		total += computer.gigabyteMb.getPrice();
		return total;
	}
	
	public void printTotalMoney(Computer1 computer) {
		System.out.println(computer.totalMoney(computer));
	}
	
	public void sayWork(Computer1 computer) {
		computer.amdCpu.work();
		computer.kingstonMem.work();
		computer.seagateHd.work();
		computer.gigabyteMb.work();
	}


	public String getAmdCpu() {
		return amdCpu.getName();
	}

	public String getKingstonMem() {
		return kingstonMem.getName();
	}


	public String getSeagateHd() {
		return seagateHd.getName();
	}


	public String getGigabyteMb() {
		return gigabyteMb.getName();
	}

	
	public void sayModule(Computer1 computer) {
		System.out.println(computer.getAmdCpu());
		System.out.println(computer.getKingstonMem());
		System.out.println(computer.getSeagateHd());
		System.out.println(computer.getGigabyteMb());
		
	}
	
}
